extends FunctionCard

func _init() -> void:
	cost = 2
	card_id = "PairAdd"

func _ready() -> void:
	card_name = "对加加"
	self_destruction = false
	self_description = "在算分时，每打出一个对子便追加15分"
	trigger_timing = 2
	label.text = card_name
	self_descrpition_label.text = self_description

func cardFunction(deck,scoreMapping,selectedCardsDetail):
	if selectedCardsDetail.detail == "对子":
		var count = selectedCardsDetail.count
		selectedCardsDetail.addScore += count * 15
		showRunDetail()
		run_detail.text = "+" + str(count * 15) + "分"
		await get_tree().create_timer(0.5).timeout  # 等待0.5秒
		hideRunDetail()
		
